package pierwszy;

import org.openqa.selenium.NoSuchWindowException;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ui.WebDriverWait;

public class KsPPage extends KsPDKPage{
	
	private WebDriver driver;
	private WebDriverWait wait;
	
	KsPPage(WebDriver driver, WebDriverWait wait){
		super(driver, wait);
		this.driver = driver;
		this.wait = wait;

		if(!driver.getTitle().equals("Centrum Ksiegowości i Edukacji Finansowej - panel administratora")){
			throw new NoSuchWindowException("This is not the KsPortal page");
		}
		
		if(!getPortalTypeText().getText().equals(KsPDKPage.siteTypeMap.get("Portal"))){
			//throw new NoSuchWindowException("This is not the Note page");
			System.out.println("Duuupa KsPPage");
		}
	}

	public KsPPage typeNip (String nipValue){
		WebElement nip = driver.findElement(KsPPageUiMapping.nipInput);
		
		nip.sendKeys(nipValue);
		
		return this;
	}
}
